<!-- Generated automatically from an XML file of the same name.
     Copyright: Stephen J. Sangwine and Nicolas Le Bihan, 2008-2010.
--><html><head>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
   <title>scalar_product :: Functions (Quaternion Toolbox Function Reference)
</title><link rel="stylesheet" href="qtfmstyle.css" type="text/css"></head><body><h1>Quaternion Function Reference</h1><h2>scalar_product</h2>
<p>Scalar product</p>
<h2>Syntax</h2><p><tt>Y = scalar_product(A, B)</tt></p>
<h2>Description</h2>
<p>
<tt>scalar_product(A, B)</tt> computes the scalar product of
two quaternion arrays, elementwise on the components.
</p>
<p>
The scalar product of two quaternions is the sum of the products of their
respective components. It is defined for both pure and full quaternions and
in both cases can also be defined as the product of the moduli multiplied
by the cosine of the angle between the two quaternions (in 3-space for pure
quaternions, 4-space for full quaternions). The scalar product of perpendicular
quaternions is zero.
</p>
<p>
The two operands must be of the same size.
</p>
<p>
For the inner product of two quaternion vectors, see the MATLAB&reg; function
<tt>dot</tt> which works for quaternions.
</p>

<h2>Examples</h2>
<pre>
&gt;&gt; scalar_product(qi, qj)

ans = 0
</pre>

<h2>See Also</h2>MATLAB&reg; function: <a href="matlab:doc dot">dot</a><br>
<h4>&copy; 2008-2010 Stephen J. Sangwine and Nicolas Le Bihan</h4><p><a href="license.html">License terms.</a></p></body></html>